<template>
  <div class="openShop">
    <avue-crud
      ref="crud"
      style="width:100%"
      :data="loadData"
      :option="tableOption"
      :table-loading="loading"
    >
    <template slot-scope="scope" slot="indexLabel">
        <span>{{scope.row.$index+(page.current - 1) * page.size + 1}}</span>
      </template>
      <template slot="menu" slot-scope="scope">
        <!-- <el-button @click="peidan(scope.row)" type="text" icon="el-icon-s-management">配单</el-button>
        <el-button @click="del(scope.row)" type="text" icon="el-icon-document-delete">作废</el-button> -->
        <el-button @click="peidan(scope.row)" type="text" icon="el-icon-s-management">审核</el-button>
        <el-button @click="details(scope.row)" type="text" icon="el-icon-view">详情</el-button>
      </template>
    </avue-crud>
    <template>
      <div style="width:100%;position:relative;height:100px">
        <el-pagination
          :page-sizes="[10, 20,30,40, 50, 100]"
          :pager-count="7"
          :current-page="page.current"
          :page-size="page.size"
          :total="page.total"
          layout="total, sizes, prev, pager, next, jumper"
          style="margin:2% 0;position:absolute;right:1%"
          background
          @size-change="sizeChange"
          @current-change="currentChange"
        ></el-pagination>
      </div>
    </template>
    <el-dialog title="审核" :visible.sync="dialogVisible" width="30%">
      <el-form
        :model="ruleForm"
        :rules="rules"
        ref="ruleForm"
        label-width="100px"
        class="demo-ruleForm"
      >
        <el-form-item label="审核">
          <el-radio v-model="ruleForm.auditStatus" label="01">审核通过</el-radio>
          <el-radio v-model="ruleForm.auditStatus" label="02">驳回</el-radio>
        </el-form-item>
        <el-form-item label="驳回原因" v-if="ruleForm.auditStatus == '02'" prop="rebutReason">
          <el-input type="textarea" :rows="2" placeholder="请输入驳回原因" v-model="ruleForm.rebutReason"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="close">取 消</el-button>
        <el-button type="primary" @click="sure" :loading="loadingSure">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script src='./openShop.js'></script>

<style lang="scss">
.openShop {
  margin: 10px 0px;
}
</style>